package com.example.quce.controller;

import com.example.quce.common.R;
import com.example.quce.entity.FunnyTest;
import com.example.quce.mapper.FunnyTestMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class FunnyTestController {
    @Autowired
    FunnyTestMapper funnyTestMapper;

    // 根据id查询测试结果
    @GetMapping("/selectTestById/{id}")
    public R selectTestById(@PathVariable("id") int id) {
        FunnyTest funnyTest=new FunnyTest();
        funnyTest=this.funnyTestMapper.selectTestById(id);
        return R.ok(funnyTest.getTestname());
    }
}
